package client

import (
	"context"
	"device-admin/internal/app/grpc/protoc/advertisingc"

	"192.168.1.75/go-pkg/errorx"
	"192.168.1.75/go-pkg/logx"
	"192.168.1.75/go-pkg/svsdis"
)

// GetAdvertisingClient 获取grpc客户端
func GetAdvertisingClient() (advertisingc.AdvertisingServiceClient, error) {
	conn, err := svsdis.GRPCConn("advertising")
	if err != nil {
		logx.Error(context.Background(), "GetAdvertisingClient err")
		return nil, errorx.New("获取服务失败", -1)
	}
	cli := advertisingc.NewAdvertisingServiceClient(conn)
	return cli, nil
}
